<script type="text/javascript">
 $(document).ready(function(){
   var h1 = $(".container1").height();
   var h2 = $(".container3").height();
   var H = $(window).height();
   $(".container2").css("height",H-h1-h2);
   var clearstyle = function(num,order){
		order = (order === undefined ? 0 : order); // b默认值为2
		for(var i=1;i<=num;i++){
			$(".nav"+i).removeClass("nav"+i+"on");
		} //清除
		if(order!=0){
		$(".nav"+order).addClass("nav"+order+"on"); //展示
		}
   };
   // 点击功能方法
   $(".nav1").click(function(){
    $("#home").load("home.html", function() {
      console.log("==========位置=============");
      var json_dict = {"command": "位置", "cookies": database.cookies};
      var json_text = JSON.stringify(json_dict);
      console.log(json_text);
      sdmg(json_text);  //ws.send(json);  判断连接正常才发送
	  clearstyle(6,1);
    });
   });

  // 人物首页
  $(".nav2").click(function(){
    clearstyle(6,2);
    $(".page").load("page/player_attr.html");
  });

  $(".nav3").click(function(){
    clearstyle(6,3);
    window.location.href = "";
  });

  $(".nav4").click(function(){
    clearstyle(6,4);
    window.location.href = "";
  });

  $(".nav5").click(function(){
    clearstyle(6,5);
    window.location.href = "";
  });

  $(".nav6").click(function(){
	clearstyle(6,6);
    //window.location.href = "";
  });
})
</script>


<!-- 弹窗界面 -->
<div class="black" style="display: none;"></div>
<div class="tkbox2" style="display: none;"></div>

<div class="page">
  <!-- 方位界面 -->
  <div class="container1">
    <div class="header">
      <div class="h_l"><a href="#"><img src="images/sj.png" alt=""></a></div> 
      <div class="title" id="title"></div>
      <div class="h_r"><a href="#"><img src="images/dt.png" alt=""></a></div>
    </div>

    <!-- 当前方位介绍 style="font-size:13px" -->
    <div class="txt01" id="introduce">
      <p></p>
    </div>

    <!-- 方位界面 -->
    <div class="box01">
      <img src="images/img01.jpg" alt="" class="img01">
      <div class="box01_con">
        <!-- 西北 westnorth -->
        <a href="javascript:void(0)" class="but01 tm filter" id="westnorth"></a>
        <!-- 北 north -->
        <a href="javascript:void(0)" class="but01 filter" id="north"></a>
        <!-- 东北 eastnorth -->
        <a href="javascript:void(0)" class="but01 filter" id="eastnorth"></a>
        <!-- 西 west -->
        <a href="javascript:void(0)" class="but01 filter" id="west"></a>
        <!-- 当前场景 localhost -->
        <a href="javascript:void(0)" class="but01 but01on" id="local"></a>
        <!-- 东 east -->
        <a href="javascript:void(0)" class="but01 filter" id="east"></a>
        <!-- 西南 westsouth -->
        <a href="javascript:void(0)" class="but01 filter" id="westsouth"></a>
        <!-- 南 south -->
        <a href="javascript:void(0)" class="but01 filter" id="south"></a>
        <!-- 东南 eastsouth -->
        <a href="javascript:void(0)" class="but01 filter" id="eastsouth"></a>
      </div>
    </div>
  </div>

  <!-- 物资界面 -->
  <div class="container2">

    <!-- 人物界面 -->
    <div class="box02">
    </div>
  </div>

</div>

<!-- 聊天跟功能界面 -->
<div class="container3">
  <!-- 聊天界面 -->
  <div class="txt02">
    <a class="lt"><img src="images/ico05.png" alt=""></a>
  </div>

  <!-- 功能界面 -->
  <div class="nav">
    <a href="javascript:void(0)" class="nav1"></a>
    <a href="javascript:void(0)" class="nav2"></a>
    <a href="javascript:void(0)" class="nav3"></a>
    <a href="javascript:void(0)" class="nav4"></a>
    <a href="javascript:void(0)" class="nav5"></a>
    <a href="javascript:void(0)" class="nav6"></a>
  </div>
</div>